# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=sherlocked
pkgver=1.f190c2b
pkgrel=2
groups=('blackarch' 'blackarch-packer' 'blackarch-binary' 'blackarch-crypto'
        'blackarch-backdoor')
pkgdesc='Universal script packer-- transforms any type of script into a protected ELF executable, encrypted with anti-debugging.'
arch=('x86_64' 'aarch64')
url='https://github.com/elfmaster/sherlocked'
license=('custom:unknown')
depends=('glibc')
makedepends=('git')
source=("git+https://github.com/elfmaster/$pkgname.git")
sha512sums=('SKIP')

pkgver() {
  cd $pkgname

  echo $(git rev-list --count HEAD).$(git rev-parse --short HEAD)
}

build() {
  cd $pkgname

  make
}

package() {
  cd $pkgname

  install -Dm 755 -t "$pkgdir/usr/bin" $pkgname stub utils/gen_shellcode \
    utils/stripx

  mv "$pkgdir/usr/bin/gen_shellcode" "$pkgdir/usr/bin/gen-shellcode"

  install -Dm 644 -t "$pkgdir/usr/share/doc/$pkgname/" README
}

